<template>
  <el-dialog title="查看" :visible.sync="visible" width="60%;">
    <div
      style="
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 500px;
      "
    >
      <div>
        <h2 style="margin-bottom: 10px">{{ dataForm.title }}</h2>
      </div>
      <div style="margin-bottom: 10px; font-weight: 100; font-size: 12px">
        {{ dataForm.createTime }}
      </div>
      <div v-html="dataForm.content"></div>
    </div>

    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
    </span>
  </el-dialog>
</template>
  
  <script>
import { getDataInfo } from "@/api/guide";
export default {
  data() {
    return {
      visible: false,
      dataForm: {
        content: "",
      },
    };
  },
  mounted() {},
  methods: {
    init(id) {
      this.visible = true;
      this.$nextTick(() => {
        if (id) {
          getDataInfo(id)
            .then((data) => {
              if (data && data.code === 0) {
                this.dataForm = data.data;
              }
            })
            .catch((err) => {
              console.log(err);
            });
        }
      });
    },
  },
};
</script>
  